<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>修改密码</title>
		<!--<link rel="stylesheet" type="text/css" href="css/base.min.css" />
		<link rel="stylesheet" type="text/css" href="css/common.css" />-->
		<link rel="stylesheet" type="text/css" href="{:_SKIN}/user/layui/css/layui.css" media="all" />
		<link rel="stylesheet" type="text/css" href="{:_SKIN}/user/css/baojia.css" />
		<!-- <script src="{:_SKIN}/user/layui/lay/dest/layui.all.js" type="text/javascript" charset="utf-8"></script> -->
		<style type="text/css">
			.content{
				font-size: 14px;
			}
			.add input,.add label{
				margin: 5px auto;
			}
			.btn{
				margin-top: 10px;
				background: #ff6600;
			}
		</style>
	</head>

	<body>
		<div class="content">
			<div class="titlebar">
				<div class="titlebar-name">修改密码</div>
			</div>
			<form class="layui-form add" id="pass" method="post" style="margin-top: 30px;">
				<div class="layui-form-item">
					<label class="layui-form-label">原密码：</label>
					<div class="layui-input-inline">
						<input   name="pass"   placeholder="请输入密码" autocomplete="off" class="layui-input  s_pass">
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">新密码：</label>
						<div class="layui-input-inline">
							<input  name="password" id="password" placeholder="请输入密码" autocomplete="off" class="layui-input s_password">
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">确认密码：</label>
							<div class="layui-input-inline">
								<input  name="word" id="word"   placeholder="请输入密码" autocomplete="off" class="layui-input s_word">
							</div>
							<div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn btn layui-btn-danger" onclick="but();" type="button"  lay-submit lay-filter="formDemo">立即确认</button>
    </div>
  </div>
			</form>
			
			</div>
		    {:jq()}
			{:layui()}

			<script type="text/javascript">
			function but(){

				var data={
					pass:$(".s_pass").val(),
					password:$(".s_password").val(),
					word:$(".s_word").val()
				};
				if(!data.pass || data.password!=data.word){

					alert('请输入正确密码');
					 return false;
				}
				$.post("{:url('user/buyers/password')}",data,function(res){

					if(res.code==200){
                        alert('密码修改成功');

						window.location.href="{:url('indexs')}"
					
					}else{

                        alert(res.msg);
					}



				});
			}


			</script>
	</body>

</html>